const path = require("path");
function resolve(dir) {
  return path.join(__dirname, dir); //path.join(__dirname)设置绝对路径
}
module.exports = {
  chainWebpack: (config) => {
    config.resolve.alias
      .set("@", resolve("./src"))
      .set("components", resolve("./src/components"))
      .set("views", resolve("./src/views"))
      .set("utils", resolve("./src/utils"))
      .set("assets", resolve("./src/assets"))
      .set("common", resolve("./src/common"))
      .set("network", resolve("./src/network"));
    //set第一个参数：设置的别名，第二个参数：设置的路径
  },

  // configureWebpack: {
  //   devServer: {
  //     proxy: {
  //       "/api": {
  //         target: "http://127.0.0.1:8082",
  //         changeOrigin: true,
  //         pathRewrite: {
  //           // 路径重写
  //           "^/api": "",
  //         },
  //       },
  //     },
  //   },
  // },
};
